<?php
$q=$_GET["q"];
$con = mysql_connect('localhost', 'feseor5_fese', 'Ws666AdQe');
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

  echo "funciona";
mysql_select_db("feseor5_miportaldev02", $con);
mysql_query("SET NAMES 'utf8'");
$sql="SELECT cve_carrera, nmb_carrera FROM cat_carrera JOIN cat_ies USING (id_institucional) WHERE id_cat_ies= ".$q;

$result = mysql_query($sql);

echo "<select name='insCarrera' id='insCarrera'>";

while($row = mysql_fetch_array($result))
  {
  echo "<option value=\"".$row['cve_carrera']."\">".$row['nmb_carrera'] . "</option>";
  }
  echo"<option value=\"0\">Otro</option>";
echo "</select>";


mysql_close($con);
?>